//package com.bsj.power.pls.handle;
//
//import com.alibaba.fastjson.JSON;
//import com.bsj.dataHandle.dto.BoltDataIn;
//import com.bsj.dataHandle.dto.BoltDataOut;
//import com.bsj.dataHandle.service.doRun.BoltBiz;
//import com.bsj.power.common.constant.HandleServiceConstant;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.weaver.World;
//import org.springframework.stereotype.Service;
//
///**
// * @author LiJiaXin
// * @version 1.0.0
// * @description TrackInfoWriteServiceImpl
// * @time 2024/4/24 10:51
// */
//@Service(HandleServiceConstant.TRACK_INFO_WRITE_SERVICE)
//@Slf4j
//public class TrackInfoWriteServiceImpl implements BoltBiz {
//    @Override
//    public void init() {
//
//    }
//
//    @Override
//    public void stop() {
//
//    }
//
//    @Override
//    public String getBizTag() {
//        return HandleServiceConstant.TRACK_INFO_WRITE_SERVICE;
//    }
//
//    @Override
//    public BoltDataOut doRun(BoltDataIn boltDataIn) {
//        World world = null;
//        Object t = boltDataIn.getT();
//        if (t instanceof World) {
//            world = (World) t;
//        }
//        if (world == null) {
//            return null;
//        }
//        Object body = world.getBody();
//        if (!(body instanceof Pos) && !(body instanceof AnswerPos)) {
//            return null;
//        }
//        Pos pos = null;
//        if (body instanceof Pos) {
//            pos = (Pos) body;
//        } else {
//            pos = ((AnswerPos) body).getPos();
//        }
//        GWVehicleInfo vehicleInfo = VehicleCachedThread.getVehicleInfo(world.getId());
//        String plate = vehicleInfo.getPlate();
//        Long groupId = vehicleInfo.getGroupId();
//        Group group = groupCached.getGroupByGroupId(groupId);
//        String groupName = group.getGroupName();
//        String driverName = "";
//        String signDriverDtoStr = jedisClusterBSJ.hget(RedisConstant.TAXI_SIGN_IN_DRIVER, vehicleInfo.getVehicleId() + "");
//        if (signDriverDtoStr != null && !"".equals(signDriverDtoStr)) {
//            SignDriverDto signDriverDto = JSON.parseObject(signDriverDtoStr, SignDriverDto.class);
//            driverName = signDriverDto.getName();
//        }
//        TrackInfo trackInfo = new TrackInfo(pos, plate, driverName, groupName);
//        trackInfo.setTerminalNo(world.getId());
//        TrackInfoWriteToRedis.push(JSON.toJSONString(trackInfo).getBytes());
//        return null;
//    }
//}
